package com.woniu.teachmall.service.service;

import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

//日志记录
@Component
public class LogService {
    public void logOperation(String operator, String operation, String target, boolean result, String details) {
        // 在实际应用中，这里会将日志保存到数据库
        // 这里简化为控制台输出
        System.out.println("===== 管理员操作日志 =====");
        System.out.println("时间: " + LocalDateTime.now());
        System.out.println("操作人: " + operator);
        System.out.println("操作: " + operation);
        System.out.println("目标: " + target);
        System.out.println("结果: " + (result ? "成功" : "失败"));
        System.out.println("详情: " + details);
        System.out.println("=======================");
    }
}
